package com.learn.springboot.service;

import com.learn.springboot.domain.User;
import com.learn.springboot.repository.UserRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author dyz
 * @date 2020/6/13 18:03
 */
@Service
public class UserService {
    @Resource
    private UserRepository userRepository;

    public User findUserByName(String username) {
        return userRepository.findUserByUsername(username);
    }

    public void saveUser(User user) {
        userRepository.save(user);
    }
}
